#ifndef FND_GAME_LOGIC_H___
#define FND_GAME_LOGIC_H___
#include <boost/noncopyable.hpp>
#include "message_manager.h"
class CLTClientShell ;
class ILTMessage_Read ;
class LTEffectShader ;
class CRenderStyle ;
class LTShaderDeviceState ;
class LTObject ;
typedef LTObject* HOBJECT ;
class shader_manager ;

class game_logic : boost::noncopyable {
public:
    virtual ~game_logic() ;
    void render() ;
    virtual void update()  = 0 ;
    virtual void render_for_shader() = 0 ;
    virtual void on_key_down(int key, int rep) {}
    virtual void on_key_up(int key) {}
    virtual void on_enter_world() = 0 ;
    virtual void on_event(int event_type){}
    game_logic(CLTClientShell* s)  : m_shell(s) {}
    virtual shader_manager* game_shader_manager() {return 0 ;}
    void on_message(ILTMessage_Read* pMsg) ;
    virtual void on_effect_shader_set_params(LTEffectShader* pEffect, CRenderStyle* pRenderStyle,
                                     HOBJECT hObj, const LTShaderDeviceState& ShaderDeviceState){}
    
private:
    CLTClientShell* m_shell ;
protected:
    virtual void do_render_2d(float frame_time) = 0 ;
    virtual void do_render_3d(float frame_time) = 0 ;
    typedef Utility::message_manager<unsigned int, ILTMessage_Read*>
    game_message_manager_type ;
    game_message_manager_type m_message_manager ;
    CLTClientShell* shell() {return m_shell ;}
} ;
#endif
